package cc.sjfx.sharedoc.widget.adapter;

import java.util.List;

import cc.sjfx.sharedoc.R;
import cc.sjfx.sharedoc.bean.FileInfo;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class FileListAdapter extends BaseAdapter {
	private List<FileInfo> list;
	private Context context;
	public FileListAdapter(Context context,List<FileInfo> list){
		this.context=context;
		this.list=list;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		TextView fileNameText ;
		arg1=LayoutInflater.from(context).inflate(R.layout.listview_file_item, null);
		fileNameText=(TextView)arg1.findViewById(R.id.fileNameText);
		fileNameText.setText(list.get(arg0).getFileName());
		return arg1;
	}

}
